import java.util.*;

public class HomeWork {
    public static void homework1() {
        int sum = 0;
        for (int i = 1; i <= 100; i++) {
            if (i % 15 == 0) {
                sum += i;
            }
        }
        System.out.println("和为："+sum);
    }

    public static void homework2() {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        switch (n) {
            case 1:
                System.out.println("新建");
                break;
            case 2:
                System.out.println("打开文件");
                break;
            case 3:
                System.out.println("保存");
                break;
            case 4:
                System.out.println("刷新");
                break;
            case 5:
                System.out.println("退出");
                System.exit(0);
        }
    }

    public static void homework3() {
        int[] arr1 = new int[]{1, 5, 3, 2, 4};
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < 5; i++) {
            min = Math.min(min, arr1[i]);
        }
        System.out.println(min);

        int[] arr2 = new int[5];
        int up = 100;
        int down = 1;
        for (int i = 0; i < 5; i++) {
            arr2[i] = (int) (Math.random() * (up - down) + down);
        }
        System.out.println("数组为："+Arrays.toString(arr2));
        Arrays.sort(arr2);
        System.out.println("排序后为："+Arrays.toString(arr2));
        System.out.println("最小值是："+arr2[0]);
    }

    public static void homework4() {
        System.out.println("请输入班级人数：");
        Scanner scanner = new Scanner(System.in);
        int num = Integer.parseInt(scanner.nextLine());
        int[] scores = new int[num];
        int up = 100;
        int down = 0;
        for (int i = 0; i < num; i++) {
            scores[i] = (int) (Math.random() * (up - down));
        }
        System.out.println("班级分数为"+Arrays.toString(scores));
        int countOfBelow60 = 0;
        int sum = 0;
        for (int i = 0; i < num; i++) {
            if (scores[i] <= 60) {
                countOfBelow60++;
            }
            sum += scores[i];
        }
        System.out.println("不及格人数：" + countOfBelow60);
        System.out.println("班级平均分：" + (double)sum/num);
    }

    public static void main(String[] args) {
        System.out.println("--------第一题--------");
        homework1();
        System.out.println("--------第二题--------");
        homework2();
        System.out.println("--------第三题--------");
        homework3();
        System.out.println("--------第四题--------");
        homework4();
    }
}
